package com.bumblebee.server.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

/**
 * 
 * @author Dinesh
 *
 */
//TO:DO Add supplier to purchase order relationships
@Entity
public class Supplier extends AbstractEntity{

	private String name;
	
	@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
	@JoinColumn(name = "supplier_id")
	private Set<Address> addresses = new HashSet<Address>();
	
	@OneToOne
	private CommunicationDetails contactInfo;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	
	public CommunicationDetails getContactInfo() {
		return contactInfo;
	}

	public void setContactInfo(CommunicationDetails contactInfo) {
		this.contactInfo = contactInfo;
	}

	public Set<Address> getAddresses() {
		return addresses;
	}

	public void setAddresses(Set<Address> addresses) {
		this.addresses = addresses;
	}
	
	
}
